//
//  Lambertian.hpp
//  RayTracer
//
//  Created by 俞云康 on 4/6/16.
//  Copyright © 2016 yushroom. All rights reserved.
//

#ifndef Lambertian_hpp
#define Lambertian_hpp

#include "BxDF.hpp"

class Lambertian : public BxDF {
private:
    Color reflectance;
    
public:
    Lambertian(const HitInfo* hit, const Color& reflectance)
    : BxDF(hit, BxDFType(BxDF_REFLECTION | BxDF_DIFFUSE)), reflectance(reflectance) { }
    
    virtual Color f(const Direction& wo, const Direction& wi) const override {
        return reflectance * INV_PI;
    }
    
    //virtual Color sample_f(const Direction& woL, Direction* wiL, const Sample& sample, float*pdf) const override {
    //    return reflectance;
    //}
    
    virtual Color rho(const Direction& w, const std::vector<Sample>& samples) const override {
        return reflectance;
    }
    
    virtual Color rho(const std::vector<Sample>& samples_o, const std::vector<Sample>& samples_i) const override {
        return reflectance;
    }
};


#endif /* Lambertian_hpp */
